diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
| commit | a367f605b842ad0a71a63025da15ac62ed0364a5 (patch) | |
| tree | b15150fbe219d1905b98570ebafb5063d0ade1b1 /src/pages/article/[slug].tsx | |
| parent | 6092ad0c91e0dc268e5988174db87ded14e6c931 (diff) | |
chore: add a breadcrumb component
Diffstat (limited to 'src/pages/article/[slug].tsx')
| -rw-r--r-- | src/pages/article/[slug].tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index bb11220..621b2e2 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -1,6 +1,6 @@ import CommentForm from '@components/CommentForm/CommentForm'; import CommentsList from '@components/CommentsList/CommentsList'; -import Layout from '@components/Layouts/Layout'; +import { getLayout } from '@components/Layouts/Layout'; import PostFooter from '@components/PostFooter/PostFooter'; import PostHeader from '@components/PostHeader/PostHeader'; import { t } from '@lingui/macro'; @@ -11,7 +11,6 @@ import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import Head from 'next/head'; import { ParsedUrlQuery } from 'querystring'; -import { ReactElement } from 'react'; const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { const { @@ -53,9 +52,7 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { ); }; -SingleArticle.getLayout = function getLayout(page: ReactElement) { - return <Layout>{page}</Layout>; -}; +SingleArticle.getLayout = getLayout; interface PostParams extends ParsedUrlQuery { slug: string; @@ -70,9 +67,11 @@ export const getStaticProps: GetStaticProps = async ( ); const { slug } = context.params as PostParams; const post = await getPostBySlug(slug); + const breadcrumbTitle = post.title; return { props: { + breadcrumbTitle, post, translation, }, |
